<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="./css/pintuer.css">
    <link rel="stylesheet" href="./css/admin.css">
    <script src="./js/jquery.js"></script>
    <script src="./js/pintuer.js"></script>
    <script src="./js/vuejs-2.5.16.js"></script>
    <script src="./js/axios-0.18.0.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="./element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="./element-ui/lib/index.js"></script>

</head>
<body>
<div class="panel admin-panel" id="userListDiv">
    <div class="panel-head"><strong class="icon-reorder"> 用户信息</strong>
    </div>

    <table class="table table-hover text-center">
        <tr>
            <th width="12%">序号</th>
            <th width="15%">ID</th>
            
            <th width="15%">昵称</th>
           
			<th width="5%">性别</th>
			<th width="12%">城市</th>
       
            <th width="10%">账号状态</th>
            <th width="12">操作</th>
        </tr>

        <tr v-for="(user,index) in pagination.items">
            <td style="padding-left:20px;">{{index+1}}</td>
            <td width="15%">{{user.id}}</td>
            <td width="15%">{{user.nickname}}</td>
            <td v-if="user.gender=='man'" width="10%">男</td>
            <td v-if="user.gender=='woman'" width="10%">女</td>
            <td width="15%">{{user.city}}</td>
            <td width="10%">未知</td>
            <td width="10%">
                <div class="button-group">
                    <a class="button border-main" :href="'/location.html?userId='+user.id" ><span class="icon-edit"></span>查看</a>
                </div>
            </td>
        </tr>



        <tr>
            <td colspan="7" style="text-align:left;padding-left:20px;">
              
				<span>总记录数：{{pagination.counts}}</span>
            </td>
        </tr>
        <tr>
            <td colspan="8">
                <!--分页组件-->
                <div class="block">
                    <el-pagination
                            @size-change="handleSizeChange"
                            @current-change="handleCurrentChange"
                            :current-page="pagination.page"
                            :page-size="pagination.pagesize"
                            :total="pagination.counts"
                            background
                            layout="prev, pager, next"
                    >
                    </el-pagination>

                </div>
            </td>
		</tr>
    </table>
</div>
<script type="text/javascript">
    const app = new Vue({
        el: '#userListDiv',
        data: {
            cid:"",
            keyword:"",
            pagination:{}
        },
        methods: {
            handleSizeChange(pagesize){
                this.pagination.pagesize=pagesize
                this.findList()
            },
            handleCurrentChange(page){
                this.pagination.page=page
                this.findList()
            },
            findList(){
                axios.get('manage/users',{
                    params:{
                        "page":this.pagination.page,
                        "pagesize":this.pagination.pagesize
                    }
                }).then(resp=>{
                    this.pagination = resp.data;
                })
            }
        },
        created(){
            this.findList();
        }
    })
</script>
<script src="/js/verify.js"></script>
</body>
</html>